package cn.fintecher.pangolin.entity.elastic;

import cn.fintecher.pangolin.common.enums.BaseSelect;
import cn.fintecher.pangolin.common.enums.CaseType;
import cn.fintecher.pangolin.common.enums.HistoryCaseStatus;
import cn.fintecher.pangolin.common.enums.PayStatus;
import cn.fintecher.pangolin.common.utils.Constants;
import cn.fintecher.pangolin.entity.mysql.Department;
import cn.fintecher.pangolin.entity.mysql.User;
import com.querydsl.core.annotations.QueryEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.util.Date;
import java.util.List;


@Data
@Document(indexName = Constants.HISTORY_CASES, type = Constants.HISTORY_CASES, shards = 1, replicas = 0)
@ApiModel(value = "HistoryCases", description = "历史案件池")
@QueryEntity
public class HistoryCases {

    @ApiModelProperty(value = "主键ID")
    @Id
    private String id;

    @ApiModelProperty(value = "委托方ID")
    private String principalId;

    @ApiModelProperty(value = "委托方名称")
    private String principalName;

    @ApiModelProperty(value = "批次号")
    private String batchNumber;

    @ApiModelProperty(value = "案件编号")
    private String caseNumber;

    @ApiModelProperty(value = "委案日期")
    private Date delegationDate;

    @ApiModelProperty(value = "委案城市")
    private String city;

    @ApiModelProperty(value = "逾期期数")
    private Integer overduePeriods;

    @ApiModelProperty(value = "逾期天数")
    private Integer overdueDays;

    @ApiModelProperty(value = "委案阶段")
    private String stage;

    @ApiModelProperty(value = "账户号")
    private String account;

    @ApiModelProperty(value = "卡号")
    private String cardNo;

    @ApiModelProperty(value = "卡类型")
    private String cardNoType;

    @ApiModelProperty(value = "开卡日期")
    private Date openCardDate;

    @ApiModelProperty(value = "停卡日期")
    private Date stopCardDate;

    @ApiModelProperty(value = "账单日")
    private String billDay;

    @ApiModelProperty(value = "卡额度")
    private Double limitAmt;

    @ApiModelProperty(value = "分行")
    private String branch;

    @ApiModelProperty(value = "支行")
    private String subBranch;

    @ApiModelProperty(value = "推广机构")
    private String extensionInfo;

    @ApiModelProperty(value = "推广员")
    private String extensionAgent;

    @ApiModelProperty(value = "委案金额")
    private Double overdueAmtTotal;

    @ApiModelProperty(value = "最新欠款金额")
    private Double leftAmt;

    @ApiModelProperty(value = "最后还款金额")
    private Double latestPayAmt;

    @ApiModelProperty(value = "最后还款日期")
    private Date latestPayDate;

    @ApiModelProperty(notes = "入催日期")
    private Date remindersDate;

    @ApiModelProperty(value = "还款总金额")
    private Double payAmountTotal;

    @ApiModelProperty("还款状态")
    private PayStatus payStatus = PayStatus.UN_PAY;

    @ApiModelProperty(value = "退案日期")
    private Date endCaseDate;

    @ApiModelProperty(value = "姓名")
    private String personalName;

    @ApiModelProperty(value = "证件号")
    private String certificateNo;

    @ApiModelProperty(value = "证件类型")
    private String certificateType;

    @ApiModelProperty(value = "性别")
    private String sex;

    @ApiModelProperty(value = "生日")
    private Date birthday;

    @ApiModelProperty(value = "移动电话")
    private String phone;

    @ApiModelProperty(value = "住宅电话")
    private String homePhoneNo;

    @ApiModelProperty(value = "单位电话")
    private String employerPhoneNo;

    @ApiModelProperty(value = "住宅地址")
    private String homeAddr;

    @ApiModelProperty(value = "户籍地址")
    private String residenceAddr;

    @ApiModelProperty(value = "单位地址")
    private String employerAddr;

    @ApiModelProperty(value = "单位名称")
    private String employerName;

    @ApiModelProperty(value = "邮箱地址")
    private String emailAddr;

    @ApiModelProperty(value = "邮寄地址")
    private String billAddr;

    @ApiModelProperty(value = "是否分配")
    private BaseSelect isDistribute;

    @ApiModelProperty(value = "创建人")
    private String operator;

    @ApiModelProperty(value = "创建时间")
    private Date operateTime;

    @ApiModelProperty(value = "更新人")
    private String updater;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "数据状态")
    private HistoryCaseStatus historyCaseStatus;

    @ApiModelProperty(notes = "催收员")
    private User currentCollector;

    @ApiModelProperty(notes = "机构")
    private Department department;

    @ApiModelProperty("删案日期")
    @Field(type = FieldType.Long)
    private Date deleteCaseDate;

    @ApiModelProperty(value = "是否结清")
    private BaseSelect isClear;

    @ApiModelProperty(value = "匹配到的策略ID")
    private String strategyId;

    @ApiModelProperty(value = "案件类型")
    private CaseType caseType;

    @ApiModelProperty(value = "未匹配字段")
    private List<UnMappedValue> unMapped;
}
